﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Linq.Expressions;
using Newtonsoft.Json.Linq;

using CanDoo;
using CanDoo.Core;
using CanDoo.Data;
using CanDoo.Web;
using CanDoo.FineUI;
using CanDoo.Extensions;
using CanDoo.Oil.Core.Models;
using CanDoo.Oil.Core.Contracts;
using CanDoo.Admin.Core.Contracts;
using FineUIPro;

namespace CanDoo.Oil.WebApp.APIAPILog
{
    public partial class Edit : EditPagebase<IAPILogContract, APILog>
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (PageMode != pagemode.Add)
                    LoadData();
            }
        }

        protected override void LoadData(APILog entity)
        {
            ed_Name.SetValue(entity.Name);
            ed_getInfo.SetValue(entity.getInfo);
            ed_sendInfo.SetValue(entity.sendInfo);
        }

        protected override OperationResult SaveData(APILog entity)
        {
            entity.Name = ed_Name.GetValue().ToString();
            entity.getInfo = ed_getInfo.GetValue().ToString();
            entity.sendInfo = ed_sendInfo.GetValue().ToString();
            return base.SaveData(entity);
            
        }
    }
}
